Skip to content

fix(ci): bump-sha PR backfill + deploy secrets + gitignore Claude artifacts#86

Merged
YiWang24 merged 5 commits into
mainfrom
fix/deploy-critical-issues
May 4, 2026
Merged

fix(ci): bump-sha PR backfill + deploy secrets + gitignore Claude artifacts#86
YiWang24 merged 5 commits into
mainfrom
fix/deploy-critical-issues

Conversation

@YiWang24

@YiWang24 YiWang24 commented May 4, 2026

Copy link
Copy Markdown
Collaborator

Summary

Three CI/infra fixes bundled together:

  • fix(deploy): pass image-digest + ssh/kubeconfig secrets to staging and production deploy jobs so the deploy step can actually authenticate and target the right image.
  • chore(gitignore): ignore Claude Code per-developer runtime artifacts (.claude/worktrees/, .claude/scheduled_tasks.lock, .claude/agents/, .claude/projects/, .claude/todos/) so they stop leaking into commits. Also adds the harness parity plan doc at docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md.
  • fix(bump-sha): harden on-main-bump-sha.yml after a silent failure where the workflow pushed chore/bump-self-sha-89792333 but never opened a PR. Root cause: gh pr create --label "chore" failed because no chore label exists, and 2>/dev/null || true swallowed the error.

bump-sha workflow changes

  • Drop the non-existent chore label and the error-swallowing redirect
  • set -euo pipefail on the run block
  • git checkout -B + git push --force-with-lease so re-runs are idempotent
  • Before opening the new PR: close older chore/bump-self-sha-* PRs (with --delete-branch and a "Superseded by" comment) and sweep orphan bump branches that never got a PR
  • gh pr create itself is now idempotent: skip if a PR already exists for the head branch

Related

Test plan

  • CI green on this PR
  • After merge, next push to main triggers on-main-bump-sha and either no-ops (SHA already current) or opens a fresh PR with all older chore/bump-self-sha-* PRs closed and their branches deleted
  • Re-running the workflow on the same commit is idempotent (no duplicate PRs, no push errors)
  • .claude/ runtime artifacts no longer show up in git status for new contributors
  • Staging + production deploys can resolve image-digest and authenticate via ssh/kubeconfig secrets

View in Codesmith
Need help on this PR? Tag @codesmith with what you need.

  • Let Codesmith autofix CI failures and bot reviews

Summary by CodeRabbit

  • Chores

    • Improved deploy workflow to accept explicit image digests, pass concrete references, and forward additional staging/production secrets.
    • Hardened automated bump process for safer branch/PR handling and reruns.
    • Renamed and cleaned up several reusable workflows and adjusted release concurrency rules.
    • Updated CI permissions for security-event write access.
  • Documentation

    • Added plan for upstream parameter parity in the harness.
  • Tests

    • Relaxed shellcheck for specific workflow integrity tests.

YiWang24 added 3 commits May 4, 2026 14:03
Addresses 4 CRITICAL issues from #82:

1. image-digest not threaded — stg.yml/prd.yml built deploy refs as
   "registry/owner/name@" + empty string, every deploy failed silently.
2. stg-image-digest + stg-deploy-time not threaded to prd — the
   observation-window safety gate was a no-op; production could ship
   without staging verification.
3. ssh-key-stg / ssh-key-prd not forwarded — docker (default) deploy
   preflight aborts without them.
4. kubeconfig-prd not forwarded — k8s deploy mode aborts without it.

## Plumbing

- Added 3 new workflow_dispatch inputs (image-digest, stg-image-digest,
  stg-deploy-time) so manual deploys take an explicit digest.
- workflow_run paths read vars.LAST_*_IMAGE_DIGEST / LAST_STG_DEPLOY_TIME
  with empty fallbacks. Upstream ci.yml / stg deploy is expected to write
  these on success — that wiring is a follow-up since GHA doesn't directly
  expose nested workflow outputs across workflow_run boundaries.
- Forwarded the full set of secrets each reusable declares
  (kubeconfig-stg, ssh-key-stg in stg; kubeconfig-prd, ssh-key-prd in
  prd) by mapping repo UPPER_SNAKE to reusable kebab-case.

Refs #82
- Add .claude/{worktrees,scheduled_tasks.lock,agents,projects,todos}
  to .gitignore so per-developer Claude Code state doesn't leak into
  the repo.
- Add docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md
  documenting the planned upstream parameter parity work for the
  _common/claude-harness wrapper.
The on-main-bump-sha workflow silently failed at `gh pr create
--label "chore"` because no `chore` label exists in the repo, and
`2>/dev/null || true` swallowed the error. Result: the workflow
pushed bump branches (e.g. chore/bump-self-sha-89792333) without
opening a PR, and stale orphan branches accumulated.

Changes:
- Drop the non-existent `chore` label from `gh pr create`.
- Remove the `2>/dev/null || true` so future PR-creation errors
  surface and fail the workflow.
- `set -euo pipefail` on the run block.
- Switch to `git checkout -B` + `git push --force-with-lease` so
  workflow re-runs on the same SHA are idempotent instead of
  failing on existing branch.
- After pushing the new branch, close older `chore/bump-self-sha-*`
  PRs against `main` with `--delete-branch` so only the latest
  bump PR is open at any time.
- Sweep orphan `chore/bump-self-sha-*` branches that never got a
  PR (the exact failure mode that just happened) and delete them.
- Make `gh pr create` idempotent: if a PR already exists for the
  branch, log and skip instead of erroring.
@qodo-code-review

Copy link
Copy Markdown
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one.

@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d185e848-0817-4222-86c1-3dd8e0765741

📥 Commits

Reviewing files that changed from the base of the PR and between 98a55b6 and 3b756a4.

📒 Files selected for processing (6)
  • .github/workflows/ci-self-test.yml
  • .github/workflows/on-main-bump-sha.yml
  • .github/workflows/reusable-agent.yml
  • .github/workflows/reusable-deps.yml
  • .github/workflows/reusable-release.yml
  • tests/actions/workflow-integrity.bats

📝 Walkthrough

Walkthrough

Adds dispatch inputs and secrets plumbing to the deploy workflow for image-digest/stage safety gates; hardens the on-main bump-sha workflow to force-replace branches, force-with-lease push, close/cleanup superseded PRs, and reuse existing PRs; renames and trims reusable workflows; small CI permission change, .gitignore entries, docs, and test linter comments.

Changes

Deploy Workflow Input & Secrets Plumbing

Layer / File(s) Summary
Input Declaration
.github/workflows/deploy.yml
Added workflow_dispatch inputs: image-digest, stg-image-digest, stg-deploy-time (strings, default empty).
Staging Reusable Integration
.github/workflows/deploy.yml
stg reusable invocation now forwards image-digest (fallback to vars.LAST_CI_IMAGE_DIGEST) and secrets kubeconfig-stg, ssh-key-stg.
Production Reusable Integration
.github/workflows/deploy.yml
prd reusable invocation now forwards image-digest, stg-image-digest, stg-deploy-time (with vars.LAST_* fallbacks) and secrets kubeconfig-prd, ssh-key-prd.

SHA Bump Workflow Hardening

Layer / File(s) Summary
Shell/Branch/Push Hardening
.github/workflows/on-main-bump-sha.yml
Commit step runs with set -euo pipefail, uses git checkout -B to recreate branch, and pushes with git push --force-with-lease.
PR Lifecycle Management
.github/workflows/on-main-bump-sha.yml
Added logic to close older auto-bump PRs whose head matches chore/bump-self-sha-* (and delete their branches), prune orphan remote branches, and reuse an existing open PR for the current head instead of unconditionally creating one. Step name updated to reflect supersession behavior.

Reusable Workflow Metadata Changes

Layer / File(s) Summary
Name changes
.github/workflows/reusable-agent.yml, .github/workflows/reusable-deps.yml
Top-level name changed: claude-harnessreusable-agent; dep-auto-mergereusable-deps.
Concurrency removal
.github/workflows/reusable-release.yml
Removed workflow-level concurrency block and added comments explaining callers should own concurrency.

CI Permissions

Layer / File(s) Summary
Permissions update
.github/workflows/ci-self-test.yml
Added security-events: write to workflow-level permissions (keeping contents: read).

Tests / Linting Adjustments

Layer / File(s) Summary
ShellCheck disables in tests
tests/actions/workflow-integrity.bats
Inserted # shellcheck disable=SC2013 comments before three for ... in $(...) loops to allow intentional word-splitting.

Developer Environment Ignore

Layer / File(s) Summary
.gitignore additions
.gitignore
Added ignore patterns for Claude Code runtime artifacts: .claude/worktrees/, .claude/scheduled_tasks.lock, .claude/agents/, .claude/projects/, .claude/todos/.

Parameter Parity Planning Documentation

Layer / File(s) Summary
Plan doc
docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md
New two-phase plan to expose additional anthropics/claude-code-action@v1 inputs via the harness with optional defaults; Phase 1 (pass-throughs and env plumbing), Phase 2 (additional YAML pass-throughs), file map, verification, and skipped-parameter rationale.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • YiAgent/OpenCI#36: Modifies deploy reusable invocations; related to image-digest and stg/prd wiring.
  • YiAgent/OpenCI#86: Overlaps on deploy.yml and on-main-bump-sha.yml edits (dispatch inputs and bump-sha handling).
  • YiAgent/OpenCI#35: Related changes to deploy reusable workflow references and input/secret forwarding.

Poem

🐰 In branches we hop and in digests we trust,

Superseding old PRs, pruning the dust.
Secrets tucked safe in each staged deploy,
Linted loops and docs bring harnessing joy—
A rabbit's small cheer for workflows robust.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes the three main changes: deploy workflow fixes (bump-sha PR backfill + deploy secrets) and gitignore additions for Claude artifacts, matching the changeset content.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/deploy-critical-issues

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

OpenCI issue agent executed:

  • escalate: needs-human

Reasoning:
Agent output did not contain a parseable action plan.

…ssues

# Conflicts:
#	.github/workflows/deploy.yml
#	.github/workflows/on-main-bump-sha.yml

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

♻️ Duplicate comments (2)
docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md (2)

379-379: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace hardcoded absolute path (duplicate issue).

Same portability issue: the path /Users/wy/projects/yiagent/OpenCI should be replaced with a relative reference or repository root variable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md` at line
379, Replace the hardcoded absolute path used in the shell command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable reference (e.g., a
repository-root variable, environment variable like $REPO_ROOT, or a relative
path) so the script works across machines; locate the literal "cd
/Users/wy/projects/yiagent/OpenCI" in the file and update it to use the chosen
repo-root symbol or a relative path and ensure any callers export or resolve
that variable before this command runs.

201-201: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace hardcoded absolute path (duplicate issue).

Same portability issue as Task 1: use a relative path or repository root placeholder instead of /Users/wy/projects/yiagent/OpenCI.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md` at line
201, Replace the hardcoded absolute cd command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable alternative: use a relative
path (e.g., "cd ./OpenCI" or "cd ../OpenCI" depending on context) or a
repository-root placeholder/lookup (e.g., "${REPO_ROOT}" or computing root via
"git rev-parse --show-toplevel") so the script is not tied to a single
developer's home directory; update the line in
docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md to use the
chosen portable form and ensure any surrounding instructions reflect that
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/deploy.yml:
- Around line 97-103: Update the input fallback and pre-checks so PRD digest
validation can't be bypassed: add vars.LAST_CI_IMAGE_DIGEST to the fallback
chain for the image-digest input (so image-digest uses inputs.image-digest ||
vars.LAST_RELEASE_IMAGE_DIGEST || vars.LAST_CI_IMAGE_DIGEST || ''), and then add
a non-empty validation step before invoking the prd path (or before calling
verify-version-align) that fails the workflow if any of image-digest,
stg-image-digest, or stg-deploy-time resolve to an empty string; ensure the
check references the inputs/vars names (image-digest, stg-image-digest,
stg-deploy-time, vars.LAST_RELEASE_IMAGE_DIGEST, vars.LAST_STG_IMAGE_DIGEST,
vars.LAST_CI_IMAGE_DIGEST) and prevents running verify-version-align/prd when
any are empty.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md`:
- Line 410: Replace the hard-coded branch name "claude/objective-galileo-742e23"
used in the git push command with a reusable placeholder (e.g.,
`<feature-branch>`) or an environment variable token (e.g., `${BRANCH_NAME}`) so
the plan is reusable; update the line `git push -u origin
claude/objective-galileo-742e23` to use the chosen placeholder/token throughout
the document wherever that branch name appears.
- Line 68: Replace the hardcoded absolute path command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable alternative—use a relative
path or a placeholder variable such as cd "${REPO_ROOT}" (and add a note to set
REPO_ROOT) or simply cd . to use the current repository root; update the line
that contains the "cd /Users/wy/projects/yiagent/OpenCI" command accordingly so
the plan is portable across machines.
- Around line 400-402: The grep command in the snippet uses an invalid option
`--exclude-path`; update the invocation that searches for the pattern
"classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch"
to either use grep's `--exclude-dir` to skip the "claude-harness" directory or
replace the pipeline with a find + grep approach to exclude paths (e.g., use
find to select "*.yml" files and filter out "*/claude-harness/*" before running
grep), ensuring the final behavior still echoes "No callers use new inputs —
backward compat confirmed" when nothing is found.

---

Duplicate comments:
In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md`:
- Line 379: Replace the hardcoded absolute path used in the shell command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable reference (e.g., a
repository-root variable, environment variable like $REPO_ROOT, or a relative
path) so the script works across machines; locate the literal "cd
/Users/wy/projects/yiagent/OpenCI" in the file and update it to use the chosen
repo-root symbol or a relative path and ensure any callers export or resolve
that variable before this command runs.
- Line 201: Replace the hardcoded absolute cd command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable alternative: use a relative
path (e.g., "cd ./OpenCI" or "cd ../OpenCI" depending on context) or a
repository-root placeholder/lookup (e.g., "${REPO_ROOT}" or computing root via
"git rev-parse --show-toplevel") so the script is not tied to a single
developer's home directory; update the line in
docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md to use the
chosen portable form and ensure any surrounding instructions reflect that
change.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: d57e23e7-f985-4407-a6d2-9196af9d48b5

📥 Commits

Reviewing files that changed from the base of the PR and between 4415cb2 and 98a55b6.

📒 Files selected for processing (4)
  • .github/workflows/deploy.yml
  • .github/workflows/on-main-bump-sha.yml
  • .gitignore
  • docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md

Comment on lines +97 to +103
# The 3 prd-specific safety-gate inputs MUST be set or the
# observation-window check is skipped silently. Source order:
# 1. workflow_dispatch input (manual override)
# 2. vars.* recorded by the upstream stg deploy on success
image-digest: ${{ inputs.image-digest || vars.LAST_RELEASE_IMAGE_DIGEST || '' }}
stg-image-digest: ${{ inputs.stg-image-digest || vars.LAST_STG_IMAGE_DIGEST || '' }}
stg-deploy-time: ${{ inputs.stg-deploy-time || vars.LAST_STG_DEPLOY_TIME || '' }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify which workflows write/read the digest variables and whether LAST_RELEASE_IMAGE_DIGEST is guaranteed.
set -euo pipefail

echo "== Writers/readers of digest/time vars =="
rg -n -C2 'LAST_(CI|RELEASE|STG)_(IMAGE_DIGEST|DEPLOY_TIME)' .github/workflows

echo
echo "== Any explicit variable writes/updates in workflows =="
rg -n -C3 '(gh variable set|LAST_RELEASE_IMAGE_DIGEST|LAST_CI_IMAGE_DIGEST|LAST_STG_IMAGE_DIGEST|LAST_STG_DEPLOY_TIME)' .github/workflows

Repository: YiAgent/OpenCI

Length of output: 4708


🏁 Script executed:

cat -n .github/workflows/deploy.yml | sed -n '75,120p'

Repository: YiAgent/OpenCI

Length of output: 3088


🏁 Script executed:

# Check the reusable-prd.yml for input validation
fd -name 'reusable-prd.yml' .github/workflows && cat -n .github/workflows/reusable-prd.yml | head -80

echo
echo "== Looking for gh variable set commands =="
rg -n 'gh variable set' .github/workflows

Repository: YiAgent/OpenCI

Length of output: 351


🏁 Script executed:

# Find reusable-prd.yml
fd 'reusable-prd' .github/

echo
echo "== Check for variable writes (broader search) =="
rg 'LAST_RELEASE_IMAGE_DIGEST|LAST_STG_IMAGE_DIGEST|LAST_STG_DEPLOY_TIME' --type yaml

echo
echo "== Check for gh command usage anywhere =="
rg 'gh ' --type yaml | head -20

Repository: YiAgent/OpenCI

Length of output: 2311


🏁 Script executed:

cat -n .github/workflows/reusable-prd.yml | head -150

Repository: YiAgent/OpenCI

Length of output: 5696


🏁 Script executed:

cat -n .github/workflows/reusable-prd.yml | sed -n '150,300p'

Repository: YiAgent/OpenCI

Length of output: 7139


🏁 Script executed:

fd 'pre-check' .openci/actions 2>/dev/null || find . -name 'pre-check' -type d 2>/dev/null | head -5

Repository: YiAgent/OpenCI

Length of output: 82


🏁 Script executed:

cat -n ./actions/prd/pre-check/action.yml

Repository: YiAgent/OpenCI

Length of output: 4041


🏁 Script executed:

cat -n ./actions/prd/observe-window/action.yml
echo
echo "=== verify-version-align ==="
cat -n ./actions/prd/verify-version-align/action.yml

Repository: YiAgent/OpenCI

Length of output: 2854


🏁 Script executed:

cat -n ./actions/prd/observe-window/check.sh

Repository: YiAgent/OpenCI

Length of output: 2210


🏁 Script executed:

# Check if there are any other places where these vars are written/set
rg 'LAST_RELEASE_IMAGE_DIGEST|LAST_CI_IMAGE_DIGEST' --type bash

Repository: YiAgent/OpenCI

Length of output: 87


🏁 Script executed:

rg 'LAST_RELEASE_IMAGE_DIGEST|LAST_CI_IMAGE_DIGEST' -t sh

Repository: YiAgent/OpenCI

Length of output: 40


🏁 Script executed:

rg 'LAST_RELEASE_IMAGE_DIGEST|LAST_CI_IMAGE_DIGEST|LAST_STG' --type yaml --type json

Repository: YiAgent/OpenCI

Length of output: 40


Add non-empty validation for PRD digest inputs; harmonize fallback chain with STG.

Lines 101-103: The image-digest and stg-image-digest inputs can resolve to empty strings (if LAST_RELEASE_IMAGE_DIGEST and LAST_STG_IMAGE_DIGEST are unset), which silently bypass digest validation in verify-version-align since equal empty strings pass the equality check. Additionally, image-digest at line 101 lacks the vars.LAST_CI_IMAGE_DIGEST fallback that the STG deployment uses at line 68, reducing resilience when LAST_RELEASE_IMAGE_DIGEST is unavailable.

Add the missing fallback to line 101 and validate all three inputs are non-empty before running prd:

Suggested hardening diff
   prd:
     if: >-
       (github.event_name == 'workflow_run'
         && github.event.workflow_run.name == 'release'
         && github.event.workflow_run.conclusion == 'success')
-      || (github.event_name == 'workflow_dispatch' && inputs.mode == 'prd')
+      || (github.event_name == 'workflow_dispatch' && inputs.mode == 'prd')
+      && ((inputs.image-digest     || vars.LAST_RELEASE_IMAGE_DIGEST || vars.LAST_CI_IMAGE_DIGEST || '') != '')
+      && ((inputs.stg-image-digest || vars.LAST_STG_IMAGE_DIGEST     || '') != '')
+      && ((inputs.stg-deploy-time  || vars.LAST_STG_DEPLOY_TIME      || '') != '')
     uses: YiAgent/OpenCI/.github/workflows/reusable-prd.yml@cd1b427370ebacb56cc9c0b418d6d8985c9be539
     with:
       app-name:            ${{ vars.APP_NAME || github.event.repository.name }}
       image-name:          ${{ vars.IMAGE_NAME || github.event.repository.name }}
       # The 3 prd-specific safety-gate inputs MUST be set or the
       # observation-window check is skipped silently. Source order:
       #   1. workflow_dispatch input (manual override)
       #   2. vars.* recorded by the upstream stg deploy on success
-      image-digest:        ${{ inputs.image-digest     || vars.LAST_RELEASE_IMAGE_DIGEST || '' }}
+      image-digest:        ${{ inputs.image-digest     || vars.LAST_RELEASE_IMAGE_DIGEST || vars.LAST_CI_IMAGE_DIGEST || '' }}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/deploy.yml around lines 97 - 103, Update the input
fallback and pre-checks so PRD digest validation can't be bypassed: add
vars.LAST_CI_IMAGE_DIGEST to the fallback chain for the image-digest input (so
image-digest uses inputs.image-digest || vars.LAST_RELEASE_IMAGE_DIGEST ||
vars.LAST_CI_IMAGE_DIGEST || ''), and then add a non-empty validation step
before invoking the prd path (or before calling verify-version-align) that fails
the workflow if any of image-digest, stg-image-digest, or stg-deploy-time
resolve to an empty string; ensure the check references the inputs/vars names
(image-digest, stg-image-digest, stg-deploy-time,
vars.LAST_RELEASE_IMAGE_DIGEST, vars.LAST_STG_IMAGE_DIGEST,
vars.LAST_CI_IMAGE_DIGEST) and prevents running verify-version-align/prd when
any are empty.

- [ ] **Step 3: Verify no YAML parse errors**

```bash
cd /Users/wy/projects/yiagent/OpenCI

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Replace hardcoded absolute path with relative path or placeholder.

The absolute path /Users/wy/projects/yiagent/OpenCI is machine-specific and reduces the portability of this plan. Use a relative path or a placeholder like cd "${REPO_ROOT}" with a note to set the variable appropriately.

📝 Suggested fix
-cd /Users/wy/projects/yiagent/OpenCI
+cd "${REPO_ROOT:-$(git rev-parse --show-toplevel)}"
 python3 -c "import yaml; yaml.safe_load(open('actions/_common/claude-harness/action.yml'))" && echo "YAML OK"

Or simply:

-cd /Users/wy/projects/yiagent/OpenCI
+# Run from repository root
 python3 -c "import yaml; yaml.safe_load(open('actions/_common/claude-harness/action.yml'))" && echo "YAML OK"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
cd /Users/wy/projects/yiagent/OpenCI
cd "${REPO_ROOT:-$(git rev-parse --show-toplevel)}"
python3 -c "import yaml; yaml.safe_load(open('actions/_common/claude-harness/action.yml'))" && echo "YAML OK"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md` at line 68,
Replace the hardcoded absolute path command "cd
/Users/wy/projects/yiagent/OpenCI" with a portable alternative—use a relative
path or a placeholder variable such as cd "${REPO_ROOT}" (and add a note to set
REPO_ROOT) or simply cd . to use the current repository root; update the line
that contains the "cd /Users/wy/projects/yiagent/OpenCI" command accordingly so
the plan is portable across machines.

Comment on lines +400 to +402
grep -r "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" \
/Users/wy/projects/yiagent/OpenCI/actions --include="*.yml" \
--exclude-path="*/claude-harness/*" | grep -v "^Binary" || echo "No callers use new inputs — backward compat confirmed"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix invalid grep option.

The --exclude-path option is not valid for grep. Use --exclude-dir to skip directories, or restructure the command to filter results differently.

🔧 Suggested fix
-grep -r "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" \
-  /Users/wy/projects/yiagent/OpenCI/actions --include="*.yml" \
-  --exclude-path="*/claude-harness/*" | grep -v "^Binary" || echo "No callers use new inputs — backward compat confirmed"
+grep -r "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" \
+  actions --include="*.yml" \
+  --exclude-dir="claude-harness" | grep -v "^Binary" || echo "No callers use new inputs — backward compat confirmed"

Or use find with grep for more control:

find actions -name "*.yml" -not -path "*/claude-harness/*" -exec grep -H "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" {} + || echo "No callers use new inputs — backward compat confirmed"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
grep -r "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" \
/Users/wy/projects/yiagent/OpenCI/actions --include="*.yml" \
--exclude-path="*/claude-harness/*" | grep -v "^Binary" || echo "No callers use new inputs — backward compat confirmed"
grep -r "classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch" \
actions --include="*.yml" \
--exclude-dir="claude-harness" | grep -v "^Binary" || echo "No callers use new inputs — backward compat confirmed"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md` around
lines 400 - 402, The grep command in the snippet uses an invalid option
`--exclude-path`; update the invocation that searches for the pattern
"classify.inline\|include.fix\|extra.permissions\|session.timeout\|plugins\|commit.signing\|bot.id\|bot.name\|base.branch"
to either use grep's `--exclude-dir` to skip the "claude-harness" directory or
replace the pipeline with a find + grep approach to exclude paths (e.g., use
find to select "*.yml" files and filter out "*/claude-harness/*" before running
grep), ensuring the final behavior still echoes "No callers use new inputs —
backward compat confirmed" when nothing is found.

- [ ] **Open a PR**

```bash
git push -u origin claude/objective-galileo-742e23

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Use a placeholder for the branch name.

The branch name claude/objective-galileo-742e23 appears to be specific to a particular implementation run. For a reusable plan document, use a placeholder like <feature-branch> or an environment variable like ${BRANCH_NAME}.

📝 Suggested improvement
-git push -u origin claude/objective-galileo-742e23
+# Replace <feature-branch> with your actual branch name
+git push -u origin <feature-branch>

Or:

-git push -u origin claude/objective-galileo-742e23
+git push -u origin "$(git branch --show-current)"
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/superpowers/plans/2026-05-02-claude-harness-param-parity.md` at line
410, Replace the hard-coded branch name "claude/objective-galileo-742e23" used
in the git push command with a reusable placeholder (e.g., `<feature-branch>`)
or an environment variable token (e.g., `${BRANCH_NAME}`) so the plan is
reusable; update the line `git push -u origin claude/objective-galileo-742e23`
to use the chosen placeholder/token throughout the document wherever that branch
name appears.

The workflow audit added in #84-era (commit 4415cb2) introduced bats
tests that were already failing on main when authored:

- `reusable workflow names match filenames` — `name:` field in
  `reusable-agent.yml` (claude-harness) and `reusable-deps.yml`
  (dep-auto-merge) didn't reference the filename suffix.
- `workflow requests security-events: write permission` —
  `ci-self-test.yml` permissions block was missing
  `security-events: write`.
- `auditor is clean against the live repository` —
  workflow-audit.sh rule W03 flagged `reusable-release.yml` for
  redeclaring the caller's `concurrency.group` (deadlock risk per
  issue #68).

Fixes:
- Rename `name:` to `reusable-agent` / `reusable-deps`.
- Add `security-events: write` to ci-self-test.yml permissions.
- Drop the `concurrency:` block from `reusable-release.yml` and
  leave the caller (release.yml) as the sole owner of the group.

All 719 bats tests now pass.
@YiWang24 YiWang24 merged commit 5c6affa into main May 4, 2026
13 of 16 checks passed
@YiWang24 YiWang24 deleted the fix/deploy-critical-issues branch May 4, 2026 18:37
@sonarqubecloud

sonarqubecloud Bot commented May 4, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented May 4, 2026

Copy link
Copy Markdown
Contributor

OpenCI issue agent executed:

  • escalate: needs-human

Reasoning:
Agent output did not contain a parseable action plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant